/**
 * 项目名称:
 *
 * @Author: 夏国倩
 * @Date: 2023/10/11 9:41
 * @Copyright
 */
package IO2;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
/*
转换流：InputStreamReader 将字节流转换成字符流
 */
public class BufferReaderTest2 {
    public static void main(String[] args) throws Exception{
       /* //字节流
        FileInputStream in=new FileInputStream("E:\\code\\TestDemo\\src\\demo\\IO2\\temp2");
        //通过转换流转换（InputStreamReader）将字节流转换成字符流
        //in是节点流，reader是包装流
        InputStreamReader reader=new InputStreamReader(in);
        //这个构造方法只能传一个字符流，不能传字节流
        //reader是节点流，br是包装流
        BufferedReader br=new BufferedReader(reader);*/

        //合并
        BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream("E:\\\\code\\\\TestDemo\\\\src\\\\demo\\\\IO2\\\\temp2")));

        String line=null;
        while ((line=br.readLine())!=null){
            System.out.println(line);
        }
        //关闭最外层
        br.close();
    }
}
